package dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import main.Jdbc;

import entity.Equipment;
import entity.Garden;
import entity.Hatchway;
import entity.Model;

public class gardenDao {

	private static List<Garden> gardenInfor;
	
	public static ArrayList GardenInformation(){

		gardenInfor=new ArrayList<Garden>();//�������϶���
		
		try {
		String sql="select id,garden_name from cropland_garden";	
			
			ResultSet rs=Jdbc.query(sql);
			
			while(rs.next()){
				Garden  garden=new Garden();
				
				garden.setId(rs.getString(1));
				garden.setGarden_name(rs.getString(2));
					
				gardenInfor.add(garden);
				
				}	
			} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		Jdbc.close();
		return (ArrayList) gardenInfor;
	}

}
